package com.mofang.ticketing.user.mapping.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 权限
 * @TableName sys_permission
 */
@NoArgsConstructor
@AllArgsConstructor
@TableName(value ="sys_permission")
@Data
public class SysPermissionDO implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 组织类型 1=平台、2=商户、3=项目成员
     */
    @TableField(value = "belong")
    private Integer belong;

    /**
     * 父级ID
     */
    @TableField(value = "parent_id")
    private Long parentId;

    /**
     * 名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 权限key
     */
    @TableField(value = "per_key")
    private String perKey;

    /**
     * 接口url
     */
    @TableField(value = "url")
    private String url;

    /**
     * 类型;0=目录、1=菜单、2=操作、按钮
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 启用状态 1=启用 0=禁用
     */
    @TableField(value = "is_enable")
    private Integer isEnable;

    public SysPermissionDO(Integer belong, Long parentId, String name, String perKey, String url, Integer type, Integer isEnable) {
        this.belong = belong;
        this.parentId = parentId;
        this.name = name;
        this.perKey = perKey;
        this.url = url;
        this.type = type;
        this.isEnable = isEnable;
    }
}